//
//  HYRoomScheduleCell.m
//  Booking
//
//  Created by Maybe_文仔 on 2018/9/4.
//  Copyright © 2018年 Duntech. All rights reserved.
//

#import "HYRoomScheduleCell.h"

@interface HYRoomScheduleCell()
@property (nonatomic, strong) UILabel *timeLab;
@property (nonatomic, strong) UIView *lineView;
@end

@implementation HYRoomScheduleCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}

-(void)setupUI{
    self.contentView.backgroundColor = [UIColor whiteColor];
    
    [self.contentView addSubview:self.timeLab];
    [self.contentView addSubview:self.lineView];
    
}

-(void)layoutSubviews{
    [super layoutSubviews];
    
    [self.timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView.mas_left).mas_offset(10);
        make.top.mas_equalTo(self.contentView);
        make.width.mas_equalTo(45);
    }];
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.timeLab.mas_right).mas_offset(10);
        make.top.right.mas_equalTo(self.contentView);
        make.height.mas_equalTo(1);
    }];
}

-(void)setTime:(NSString *)time{
    self.timeLab.text = time;
}

#pragma mark -- 懒加载

-(UILabel *)timeLab{
    if (!_timeLab) {
        _timeLab = [[UILabel alloc]init];
        _timeLab.textColor = RGBColor(51, 51, 51);
        _timeLab.font = KFont(15);
        _timeLab.textAlignment = NSTextAlignmentCenter;
    }
    return _timeLab;
}

-(UIView *)lineView{
    if (!_lineView) {
        _lineView = [[UIView alloc]init];
        _lineView.backgroundColor = RGBColor(229, 229, 229);
    }
    return _lineView;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
